package org.eztouch;

import org.eztouch.entity.UserEntity;
import org.eztouch.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {

	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring-context.xml");// 加载 spring 配置文件
		
		UserService us = (UserService) context.getBean("userService");
		
		UserEntity u = us.getUser("1");
		System.out.println("第一次查询结果："+u.getId()+"-"+u.getName());
		
		System.out.println("--------第二次查询---------");
		UserEntity u2 = us.getUser("1");
		System.out.println("第二次查询结果："+u2.getId()+"-"+u2.getName());
	}

}
